home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / code_gen / vbxwzrd / backgrnd.h~ < prev    next >
Encoding:
Text File  |  1995-02-19  |  6.1 KB  |  177 lines

  1. //---------------------------------------------------------------------------
  2. // BackGrnd.h
  3. //---------------------------------------------------------------------------
  4.  
  5. //---------------------------------------------------------------------------
  6. // Resource Information
  7. //---------------------------------------------------------------------------
  8. // Toolbox bitmap resource IDs numbers.
  9. //---------------------------------------------------------------------------
  10. #define IDBMP_BackGrnd            8000
  11. #define IDBMP_BackGrndDOWN        8001
  12. #define IDBMP_BackGrndMONO        8003
  13. #define IDBMP_BackGrndEGA         8006
  14.  
  15. //---------------------------------------------------------------------------
  16. // Update these fields for each build.
  17. //---------------------------------------------------------------------------
  18. #define VBX_VERSION                3,00,0,00
  19. #define VBX_VERSION_STR            "3.00.000"
  20.  
  21. #ifndef RC_INVOKED
  22. //---------------------------------------------------------------------------
  23. // Macro for referencing member of structure
  24. //---------------------------------------------------------------------------
  25. #define OFFSETIN(struc,field)      ((USHORT)&(((struc *)0)->field))
  26.  
  27.  
  28. //---------------------------------------------------------------------------
  29. // Control Procedure
  30. //---------------------------------------------------------------------------
  31. LONG FAR PASCAL _export BackGrndCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  32.  
  33. //---------------------------------------------------------------------------
  34. // BackGrnd control data and structs
  35. //---------------------------------------------------------------------------
  36. typedef struct tagBackGrnd
  37.     {
  38.     ENUM    About;
  39.     HPIC    Picture;
  40.     } BackGrnd;
  41.  
  42. typedef BackGrnd FAR * LPBackGrnd;
  43.  
  44. #define LpBackGrndDEREF(hctl)          ((LPBackGrnd)VBDerefControl(hctl))
  45.  
  46.  
  47. //---------------------------------------------------------------------------
  48. // Property info
  49. //---------------------------------------------------------------------------
  50.  
  51. PROPINFO Property_About =
  52.     {
  53.     "About",
  54.     DT_ENUM | PF_fGetData | PF_fSetMsg | PF_fSetMsg,
  55.     OFFSETIN(BackGrnd, About),    0,
  56.     0,
  57.     "Click on ""..."" for About Box\0",
  58.     0
  59.     };
  60.  
  61. PROPINFO Property_Picture =
  62.     {
  63.     "Picture",
  64.     DT_PICTURE | PF_fGetData | PF_fSaveData | PF_fSetData | PF_fSetMsg,
  65.     OFFSETIN(BackGrnd, Picture),
  66.     0, 0,  NULL, 0
  67.     };
  68.  
  69.  
  70. //---------------------------------------------------------------------------
  71. // Property list
  72. //---------------------------------------------------------------------------
  73. // Define the consecutive indicies for the properties
  74. //---------------------------------------------------------------------------
  75. #define IPROP_BackGrnd_CTLNAME              0
  76. #define IPROP_BackGrnd_HWND              1
  77. #define IPROP_BackGrnd_INDEX              2
  78. #define IPROP_BackGrnd_About              3
  79. #define IPROP_BackGrnd_ENABLED              4
  80. #define IPROP_BackGrnd_HEIGHT              5
  81. #define IPROP_BackGrnd_LEFT              6
  82. #define IPROP_BackGrnd_TOP              7
  83. #define IPROP_BackGrnd_VISIBLE              8
  84. #define IPROP_BackGrnd_WIDTH              9
  85. #define IPROP_BackGrnd_Picture              10
  86.  
  87. PPROPINFO BackGrnd_Properties[] =
  88.     {
  89.     PPROPINFO_STD_CTLNAME,
  90.     PPROPINFO_STD_HWND,
  91.     PPROPINFO_STD_INDEX,
  92.     &Property_About,
  93.     PPROPINFO_STD_ENABLED,
  94.     PPROPINFO_STD_HEIGHT,
  95.     PPROPINFO_STD_LEFT,
  96.     PPROPINFO_STD_TOP,
  97.     PPROPINFO_STD_VISIBLE,
  98.     PPROPINFO_STD_WIDTH,
  99.     &Property_Picture,
  100.     NULL
  101.     };
  102.  
  103.  
  104. //---------------------------------------------------------------------------
  105. // Event info
  106. //---------------------------------------------------------------------------
  107. EVENTINFO Event_BeginPaint =
  108.     {
  109.     "BeginPaint",
  110.     0,
  111.     0,
  112.     NULL,
  113.     NULL
  114.     };
  115.  
  116. EVENTINFO Event_EndPaint =
  117.     {
  118.     "EndPaint",
  119.     0,
  120.     0,
  121.     NULL,
  122.     NULL
  123.     };
  124.  
  125.  
  126. //---------------------------------------------------------------------------
  127. // Event list
  128. //---------------------------------------------------------------------------
  129. // Define the consecutive indicies for the events
  130. //---------------------------------------------------------------------------
  131. #define IEVENT_BackGrnd_BeginPaint            0
  132. #define IEVENT_BackGrnd_CLICK            1
  133. #define IEVENT_BackGrnd_DBLCLICK            2
  134. #define IEVENT_BackGrnd_EndPaint            3
  135. #define IEVENT_BackGrnd_MOUSEDOWN            4
  136. #define IEVENT_BackGrnd_MOUSEMOVE            5
  137. #define IEVENT_BackGrnd_MOUSEUP            6
  138.  
  139. PEVENTINFO 
  140. BackGrnd_Events[] =
  141.     {
  142.     &Event_BeginPaint,
  143.     PEVENTINFO_STD_CLICK,
  144.     PEVENTINFO_STD_DBLCLICK,
  145.     &Event_EndPaint,
  146.     PEVENTINFO_STD_MOUSEDOWN,
  147.     PEVENTINFO_STD_MOUSEMOVE,
  148.     PEVENTINFO_STD_MOUSEUP,
  149.     NULL
  150.     };
  151.  
  152.  
  153. //---------------------------------------------------------------------------
  154. // Model struct
  155. //---------------------------------------------------------------------------
  156. // Define the control model (using the event and property structures).
  157. //---------------------------------------------------------------------------
  158. MODEL modelBackGrnd =
  159.     {
  160.     VB_VERSION,                         // VB version being used
  161.     0,  // MODEL flags
  162.     (PCTLPROC)BackGrndCtlProc,            // Control procedure
  163.     0 | CS_HREDRAW | CS_VREDRAW,  // Class style
  164.     0L,  // Default Windows style
  165.     sizeof(BackGrnd),                       // Size of CIRC structure
  166.     IDBMP_BackGrnd,                       // Palette bitmap ID
  167.     "BackGrnd",                           // Default control name
  168.     "BackGrnd",                            // Visual Basic class name
  169.     NULL,                               // Parent class name
  170.     BackGrnd_Properties,                  // Property information table
  171.     BackGrnd_Events,                      // Event information table
  172.     0,                                  // Default property
  173.     0,                                  // Default event
  174.     };
  175. #endif  // RC_INVOKED
  176. //---------------------------------------------------------------------------
  177.